//=============================================================
// 创建人:            admin
// 创建时间:          2024/8/25
// 邮箱：             admin@example.com
//==============================================================
using LF.Domain.Entities;

namespace LF.Domain.Services
{
    public interface IDictManagerService : IDomainService
    {
        #region 字典类型管理
        /// <summary>
        /// 获取字典类型列表
        /// </summary>
        /// <param name="index">页码</param>
        /// <param name="pageSize">每页条数</param>
        /// <param name="name">字典名称</param>
        /// <param name="code">字典编码</param>
        /// <returns>字典类型列表</returns>
        List<DictType> GetDictTypeList(int index, int pageSize, string? name, string? code);

        /// <summary>
        /// 获取字典类型总数
        /// </summary>
        /// <param name="name">字典名称</param>
        /// <param name="code">字典编码</param>
        /// <returns>总数</returns>
        long CountDictType(string? name, string? code);

        /// <summary>
        /// 获取字典类型详情
        /// </summary>
        /// <param name="id">字典类型ID</param>
        /// <returns>字典类型</returns>
        DictType GetDictType(Guid id);

        /// <summary>
        /// 新增字典类型
        /// </summary>
        /// <param name="dictType">字典类型</param>
        /// <returns>是否成功</returns>
        bool InsertDictType(DictType dictType);

        /// <summary>
        /// 更新字典类型
        /// </summary>
        /// <param name="dictType">字典类型</param>
        /// <returns>是否成功</returns>
        bool UpdateDictType(DictType dictType);

        /// <summary>
        /// 删除字典类型
        /// </summary>
        /// <param name="id">字典类型ID</param>
        /// <returns>是否成功</returns>
        bool DeleteDictType(Guid id);

        /// <summary>
        /// 获取所有字典类型
        /// </summary>
        /// <returns>所有字典类型</returns>
        List<DictType> GetAllDictType();
        #endregion

        #region 字典项管理
        /// <summary>
        /// 获取字典项列表
        /// </summary>
        /// <param name="index">页码</param>
        /// <param name="pageSize">每页条数</param>
        /// <param name="typeId">字典类型ID</param>
        /// <param name="label">字典项键名</param>
        /// <param name="value">字典项值</param>
        /// <returns>字典项列表</returns>
        List<DictItem> GetDictItemList(int index, int pageSize, Guid typeId, string? label, string? value);

        /// <summary>
        /// 获取字典项总数
        /// </summary>
        /// <param name="typeId">字典类型ID</param>
        /// <param name="label">字典项键名</param>
        /// <param name="value">字典项值</param>
        /// <returns>总数</returns>
        long CountDictItem(Guid typeId, string? label, string? value);

        /// <summary>
        /// 获取字典项详情
        /// </summary>
        /// <param name="id">字典项ID</param>
        /// <returns>字典项</returns>
        DictItem GetDictItem(Guid id);

        /// <summary>
        /// 新增字典项
        /// </summary>
        /// <param name="dictItem">字典项</param>
        /// <returns>是否成功</returns>
        bool InsertDictItem(DictItem dictItem);

        /// <summary>
        /// 更新字典项
        /// </summary>
        /// <param name="dictItem">字典项</param>
        /// <returns>是否成功</returns>
        bool UpdateDictItem(DictItem dictItem);

        /// <summary>
        /// 删除字典项
        /// </summary>
        /// <param name="id">字典项ID</param>
        /// <returns>是否成功</returns>
        bool DeleteDictItem(Guid id);
        #endregion
        
        #region 字典初始化方法
        /// <summary>
        /// 初始化切片方式字典
        /// </summary>
        /// <returns>是否成功</returns>
        bool InitializeSliceTypeDict();
        #endregion
    }
} 